Some minor refactorings in the test