Refactor this code to be more readable. Do not change its behavior.
```{{language}}
{{paste your code}}
```
Constraints:
- Same inputs and outputs as the original
- Keep external API intact (function names, signatures, exports)
- Don't introduce new dependencies
- Don't add type annotations if the codebase doesn't use them
- Preserve any subtle behavior the original has (race conditions, timing, side effects)
Output:
1. The refactored code
2. A bullet list of every change you made and why (not "cleaner" — say what specifically improved)
3. Any behavior I should re-test manually because the change is non-trivial
4. One thing you'd want to refactor next, but didn't because it's out of scoperefactoringcode qualitymaintenance