Implemented the ref option in the process of cloning a template