Eliminate redundancies in app.js