refactoring patch