There is code that really needs to be rewritten. If it's so creaky that you can't make any change without breaking other things, and you aren't allowed to refactor, that's trouble. I don't take on projects like that. But in my experience it's more common with web applications to find code that has lots of room for improvement, but isn't really falling apart. Most freelance developers/consultants immediately go to "we have to rewrite it," which the business can't afford right now, and therefore deprive themselves of the maintenance business.