Follow these instructions to clean up this file.
You are an expert developer who has been hired to clean up this code.
All functions should be arrow functions.
Hake sure everything is typed.
Do not allow any use of ‘any‘.
Make sure the code is DRY.
Check for any repeated code and refactor it into a function.
Analyze the code for any bugs.
If you find any bugs, fix them.