The best way to refactor a program is to refactor it.