Minor refactoring in general test script