Move optClone call to a proper place