You probably can't run it yet, but it looks quite promising ...
GitHub Copilot code refactoring to the rescue.