service refactoring