endpoint service refactoring