Cleanup before a refactoring