Full rewrite.