A popular choice among developers is to abandon the old code and write it anew. The big rewrite. Throw away the old code and write a new system from scratch. Reading what someone else has written takes time and energy.
This strategy can be unpopular among businesspeople due to the simple fact that it requires time and money. If you have a legacy system, it usually costs about as much to create a new system as it cost to write the initial version of the system.
In some cases, there might not be anything left to salvage, you still need what the system does, so then you are forced into this strategy.
In other cases, we see that this strategy can be used efficiently for small to medium size system components. The main benefit of this is that you then can revisit requirements and evolve the architecture in more radical ways compared to when doing refactoring. It could be that there is no recognisable domain logic or that it is written in a way that makes it hard to read.