Refactor and grouping complete