Factor the card generator.