Revise rewrite rules