Removes template HTML and adds wrapper