beginning refactoring search