Refactoring test case