handle repetition of classes in grouped_cpp