Rewrite production rules work