improve write-subcategories show function to only have one view variable