change event grouping logic and tests