<instructions>
Simplify this function to its clearest equivalent form. Rules:
- Behavior stays identical, including edge cases, error paths, and return types.
- Prefer early returns over nesting; prefer clear names over comments; remove any branch that cannot execute.
- If two simplifications conflict, choose the one a new team member would understand faster.
Return the simplified function, then a short list of what changed and WHY each change is safe. If the function is already minimal, say so — do not churn code to appear useful.
</instructions>
<code>
{{code}}
</code>