Add duplicate function to Template

Add duplicate function to Template