service refactored