I've been in literally hundreds of conversations with engineers who want to refactor a given technical system and don't realize the code debt is really due to the fact human businesses run on endless edge cases and weird exceptions. They only account for the majority use cases, but the problem is the firm would get sued without complete coverage. So when they deal with the edge cases, the code looks like shit again, and then what was the point of the company spending money on the refactor ?
Application/Code Architecture in real world businesses is extremely tough given moving requirements, endless legal/financial edge cases, and subtly different but similar concepts across different business domains. It's gets even tougher when you have to make difficult decisions about cost centers and profit centers.
My firm has a super specialty team (extremely well paid) that goes in and refactors/clean's up codebase's that are identified as becoming less efficient. However even the average senior engineer lacks the experience and understanding to clean up code debt in most business codebases.