refactoring typeInfo in preparation for proper type checking