Update grouping and sorting

Change-Id: I5851217fe14c723cc94d54ff54fcd79cd84471df