initial refactoring. less in app.js
layered structure
slightly prettified