def to_type(cls, typename):
        """ Converts a type ID to name. On error returns None
        """
        NAME_TYPES = {cls.TYPE_NAMES[x]: x for x in cls.TYPE_NAMES}
        return NAME_TYPES.get(typename, None)