Comparator function cleanup