refactored category service