Added subcategory logic