moved clone to private function