extract dist comparator
extract dist comparator
cleanup