Pasteboard code refactor