Refactor/improve test for leaving group