refactoring test case