refine test script