Small refactoring in tests