Doing complete rewrite