improve completion candidate sorting