Rewrite application