Refactored category management