If the current code is crap there is a reason it ended up like that, and the same forces will be in effect to cause the rewrite to end up in the same state.
Perform a root cause analysis for why the current code is in a bad state and why it doesn’t improve over time.