refactor testcase