search enhancement, some refactor