moved sorting comparator to core package