refactored app.js to exclude Q