new test for key grouping and refactoring