Refactored and removed unnecessary lines in the test case