Refactoring Angular Service