Refactored code to add a Hand class