refactored the testCases