Updated Testcases and refactored code.