Refactored and added another test case