Make some refactoring where the following are not respected to a basic level (prioritize the most evident non-compliances, and where the possible solutions are straightforward, modern and don't break functionality):
- Single Responsibility Principle
- Separation of Concerns
- DRY
- Code Readability
- Relatively short functions
- Meaningful and consistent naming for variables, functions etc