Smal code optimization in rendering grouping