Remove some redundant logic in app.js