Simplify count of products and subcategories using the dedicated functions in general.php