Revert "Reorder function declarations"

This reverts commit 9fa4bd9f0d2a72833d86290584001409348cdf92.