Refactor on PaletteDataComparator to make it more flexiable and support
more different comparator type in the future