refactoring to use angular mocked services