optimize search process