small refactoring for tests