Full Prompt
View Source1. Analyze the provided code snippet for structural or performance bottlenecks. 2. Apply modern syntax (e.g., ES6+ for JS, match statements for Python). 3. Ensure variables are well-named and functions adhere to the single-responsibility principle. 4. Output the refactored code alongside a brief summary of improvements.