refine search, score function