Small refactoring of category tree.