minor refactorings
Extract more comparators