Rearrange function definitions.