Merge rewrite