Simplify count of products and subcategories using the dedicated functio...

...ns in general.php