Refactorizing programs