Refactoring test code.