Small refactoring for tests.