Refactor to remove duplicate code for PokerHands classes