Completing the second stage of rewrite