---
description: Refactor existing code
---
# Refactoring Request
You need to refactor the code in the following way:
{{PROMPT}}
## Refactoring Best Practices
While working on the change, keep in mind the following:
- Leave the code better than when you got it.
- Ruthlessly simplify. Maintain the core user experience, but don't shy from changes that simplify or improve.
- Add documentation for functions, classes, and modules following best practices where it is missing.
- Look for and fix bad or difficult to maintain coding patterns.
- Improving existing tests is better than adding new tests
## Final Steps
After you implement the change, please do the following steps:
- Add or update tests to make sure the refactor is working as expected
- Run linter, formatter, and unit tests and make sure they pass
- Make sure documentation is up to date. Keep it simple, but ensure documentation is accurate with the current state of the code
- Commit your changes following the Conventional Commits specification with a descriptive summary of the changes