improve search comparator