refactors search feature