Prompt
Analyze this code for refactoring opportunities:
```{{language}}
{{code}}
```
Context: {{context}}
Provide:
1. Code smells identified
2. Refactoring techniques to apply
3. Step-by-step refactoring plan
4. The refactored code
5. Tests to ensure nothing breaks
6. Before/after comparison