Refactoring to services