Small refactor for tests