editor: better implementation of cloning