refactor test case