started simple rewrite optimizer