Additional work on grouping patterns