Prepare a grouping model