refactor Category

* move callback bodies to separate methods (easier to test)