refactor the test case