refactoring views, angularjs controllers, services