refactoring patch finding