Added an underscore chain in groupBy function