Projects are well-served by scheduling time for 'technical debt', which is whatever the developers say it is. Its time to revisit code and repair/replace weak links.
I recall one project where we were allocated "refactoring" time, which turned almost immediately into performance profiling, you know, something you could see. It's like management gets itchy when they can't see change for more than 48 hours.
I worked at a place where 50% of our time was supposed to be refactoring/boy scouting/cleanup work. The codebase was so bad and delivery so painful that management endorsed it. But the pressure to deliver never let up and so that policy is now a running joke.