minor refactor of app.js