Use generic template logic for grouping template overriding