use faster map for grouping