refactor test cases