Reorder functions for dependency reasons.