A look at using AngularJS factories to refactor controllers