Refactor too-large #compare_hands