Finish the rewrite