Minor refactoring of TestHelpers