clean up clone code