Cleanup section grouping and support custom grouping for non-extended sections