refactoring and local/global searches