refactor blackjack webapp