cleaning up code a bit in app.js