Addes Search and some refactoring.