Naming & Extraction Pass
A focused refactoring pass that only improves names and extracts functions — the two changes with the highest readability payoff per line changed.
Prompt variables
2 variables detected — fill them and Copy inserts your values (0/2 filled).
Do a single-purpose refactoring pass over this code. You may ONLY do two things:
1. **Rename** variables, functions, and types so they say what they mean:
- booleans read as assertions (isExpired, hasAccess, shouldRetry)
- functions are verbs describing effect, not implementation (persistOrder, not doDbStuff)
- no abbreviations that save 3 characters and cost 3 seconds of thought
- names reflect domain language, not programmer plumbing
2. **Extract functions** where a block does one nameable thing:
- every extracted function name must make a comment above the block redundant — then delete that comment
- do not extract if the resulting function would need more than 4 parameters; note it as a data-clumping smell instead
Explicitly forbidden: changing logic, changing types, adding abstractions, "while I'm here" improvements.
Output:
- The refactored code, complete and compilable.
- A table: old name → new name → one-line justification.
- A short list of deeper smells you noticed but correctly left alone.
```{{language}}
{{code}}
```
Comments (0)