Rewrite architecture