[DEBT] - refactor inner comparator.