Refactoring test script.