Refactor the test cases.