cleanup of code in app.js