angularjs boilerplate - code review