Refactored Category generator and templates