Rewrite all code