refactors codes related in createNewDeck panel. Troy