More refactoring. CardMat.cs added