minor refactorings in tests