Minor refactoring in a test