categories code abstraction cleanup