did 1 refactoring from jdeodorant & fixed the testcases associated with it to make them work.