Reorder the static functions to avoid the need for forward declarations.