refator the testcase