partial rewrite