refactored cards and decks controller