Cleaned up the Formats.js code