Re: Just rewrite the lot as you think it ought to work. Call it refactoring if anyone asks.<p>I recently worked on someone else's code that was... terrible. Just really terrible. State information was stored as strings like "B13" to indicate that you are in part B step 13, everything was driven by line after line of twisty nested if statements.<p>My first inclination was to rewrite everything. I could have cut the size of the code in half, maybe more - but this was an existing, working system. Sometimes the right decision <i>is</i> to rewrite everything, but sometimes the right decision is to fix only what's broke. It takes experience to tell which situation you're in.