Refactoring and search core part-implementation.