refactoring test cases