Extract base classes for Type
Add checkType that takes an error code