switch between groups and plain lists in given data