Replaced comparator consts with classes to simplify api.