Simplify search function.