(refactor) Clean up comments and structure of main.js