group events in dictionary