groupBy improvements