Started to clean up app.js and modularize code