g13: Move some function around.