Adds support for grouping.