refactored app.js
refactored app.js