Pretty much rewrite code