rewrite patch translation.