services refactoring