service refactoring part 1