Revert "rearranged some things to group items logically and put the meatier functions at the top"

This reverts commit bc2d31772aadcd7ac02aec4ecbb637648de7336a.