simplify the clone function