reorder functions in source file to remove forward declarations