Refactoring to start using an Angular view model