comparer refactor