Refactor the following code according to SOLID principles and Clean Code guidelines:
Coding💾 0 savesby PromptChief
Refactor the following code according to SOLID principles and Clean Code guidelines:
```
[[SELECTED_TEXT]]
```
Address each step:
- **S** – Single Responsibility: Split classes/functions with more than one task
- **O** – Open/Closed: Extensible without modifying existing classes
- **L** – Liskov: Correct inheritance hierarchies
- **I** – Interface Segregation: Lean interfaces
- **D** – Dependency Inversion: Abstract dependencies
Show Before/After and explain each change.