Pasting optimization