Lots of rewrite