Remove duplicate entities in groups