pre-rewrite merge