Refactoring test utilities