Code refactoring on pasteboard