start moving code out of app.js