Refactoring and testging of decks.