in reply to rebuilding working code

I'm of the opinion that 'fixing' code is fine - that's what it's for.
But there comes a certain point at which you're _hacking_ code. By which I mean that you're putting in things to work around other things that don't work the way they should.
That's about the point at which you start thinking about re-writing.
It's more difficult with multiple ownership of the code. Provided it's in the public domain, and that there is someone ready, willing and able to re-do it, then as far as I'm concerned, fair enough.
Now whether this actually _does_ get re-written or not, is largely a factor (from my PoV) of how much I understand the code, it's objectives and how it does it. And how much time I have free.
Most often it's 'urgent' and needs a fix yesterday, so I'll hack it. And make a mental note to come back to it 'when I have time'. Several mental notes flags it up as 'important' - there's an old systems admin adage - if you have to do something twice, then automate and script it.