Put format functions in their own file
Squash bugs