got rid of redundant code in app.js