code refactoring, randomized card selection