There are few places in a codebase where the time saved in "developer productivity" will be greater than the time to rewrite it... and typically that's true for a "refactor" as well.
While everyone likes a nicely refactored codebase, and it does improve developer productivity and happiness, the truth is, these activities rarely have actual, measurable ROI.
J.Ja