Refactor some search stuff

:+1: