lots of rewrite