Simplified code
Removed debug code
Show subcategories in an tab if available (#566)