Added logic and tests for ClassModel