Moving clone() out of plugin.