[#31490] Duplicate code reduction in categories views (Fix #1552)