refactor code for deck check and add check to build deck