Refactor part of an anonymous function into a new compare() utility function