simplify and speed up search