minor refactoring of generate new card