Refactor the Test case for Logic