clean up generating and transition of cards