Finish rewrite