Modular rewrite