service refactor