[feature/search] Clean code and fix minor bugs