Code refactoring of search part
Revert "Code refactoring of search part"

This reverts commit 90aeb3bdd7ebaa260e73809f5e8a09b60261bfd8.