Refactoring test cases