restructured the app.js and services