Refactored code, added a test case