Function EasyReplace() refactored