Refactored the code

-Not backward compatible