Added new method renderReplace that replaces
element with template result