Online Rewrite