move the grouping code from file_data_new to filelist_read