Refined preliminary search function