Legacy code is not old code; it is code you are afraid to change because it has no tests and no one remembers how it works. This is a practical method for taming it: pinning current behavior with characterization tests, finding seams to break dependencies, making changes in reversible small steps, and using the strangler-fig pattern to replace whole subsystems without a big-bang rewrite.
Strangler-Pattern
-
Refactoring Legacy Code Safely