Rewritting code