Refactoring Legacy Code: A Practical Engineering Roadmap