Improve copy paste handling