Removes template html and adds wrapper