some refactoring for blackjack