Use grouped_slice helper.

issue3516
review10301002