moved logic to card model