refactors clipboard copy/paste