Beginning of the rewrite