refactoring and searching