     public override func invalidateCachedProperties() {
         super.invalidateCachedProperties()
 
-        hasCachedDeviceRef = false
-        cachedDeviceRef = 0
-        hasCachedManufacturerName = false
-        cachedManufacturerName = nil
-        hasCachedModelName = false
-        cachedModelName = nil
+        cachedManufacturerName = .none
+        cachedModelName = .none
+        cachedDeviceRef = .none
     }
 
     public override func propertyDidChange(_ propertyName: String!) {
         if propertyName == kMIDIPropertyManufacturer as String {
-            hasCachedManufacturerName = false
-            cachedManufacturerName = nil
+            cachedManufacturerName = .none
         }
         else if propertyName == kMIDIPropertyModel as String {
-            hasCachedModelName = false
-            cachedModelName = nil
+            cachedModelName = .none
         }
 
         super.propertyDidChange(propertyName)


    // MARK: Private

    private var hasCachedManufacturerName = false
    private var cachedManufacturerName: String?
    private var hasCachedModelName = false
    private var cachedModelName: String?

    // We set this property on the virtual endpoints that we create,
    // so we can query them to see if they're ours.


    public var manufacturerName: String? {
        get {
            switch cachedManufacturerName {
            case .none:
                let value = string(forProperty: kMIDIPropertyManufacturer)
                cachedManufacturerName = .some(value)
                return value
            case .some(let value):
                return value
            }
        }
        set {
            if cachedManufacturerName != .some(newValue) {
                setString(newValue, forProperty: kMIDIPropertyManufacturer)
                cachedManufacturerName = .none
            }
        }
    }

    public var modelName: String? {
        get {
            switch cachedModelName {
            case .none:
                let value = string(forProperty: kMIDIPropertyManufacturer)
                cachedModelName = .some(value)
                return value
            case .some(let value):
                return value
            }
        }
        set {
            if cachedModelName != .some(newValue) {
                setString(newValue, forProperty: kMIDIPropertyModel)
                cachedModelName = .none
            }
        }
    }
