refactoring test utility