Work on category manipulation, some refactoring.