Rewrite the code