working in some better programming practices

Updating the card controller