Legacy Code Refactorer
Prompt Content
Here's a legacy code snippet: [CODE]. Refactor it to improve maintainability while preserving functionality. Apply SOLID principles, modern language features, and appropriate design patterns. Explain your refactoring strategy and provide the improved code.