Refactored the test cases.