Improve: search function optimization