refactoring, shortened test helper functions