I just read this and it seems to describe refactoring almost exactly. I don’t know why I hadn’t thought of it before. Excellent.