refactors app.js