finalized service refactoring