Improving the architecture and good practices of an AngularJS app