Refactor this code to be more readable — same behavior.
CODE:
```
[[CODE]]
```
LANGUAGE: [[LANGUAGE]]
CONSTRAINTS: [[CONSTRAINTS]]
Deliver:
1. The refactored version (clear names, smaller functions, less nesting)
2. A short note on each meaningful change and why
3. Anything that hints at a deeper design issue
4. Confirmation that behavior is unchanged (or flag any risk)
5. What I deliberately left alone and why
Prioritize clarity over cleverness. Don't over-engineer.