Several adaptations to app.js file