             guard let beacon = GAPUnprovisionedDeviceBeacon(data: reducedData)
                 else { return nil }
             
-            self.init(type: .unprovisionedDevice(beacon))
+            self = .unprovisionedDevice(beacon)
             
         case .secureNetwork:
             
             guard let beacon = GAPSecureNetworkBeacon(data: reducedData)
                 else { return nil }
             
-            self.init(type: .secureNetwork(beacon))
+            self = .secureNetwork(beacon)
             
         }
     }
     
     public var data: Data {
         
-        switch type {
+        switch self {
             
         case .unprovisionedDevice(let beacon):
             

    
    public var data: Data {
        
        let bytes = UInt16(littleEndian: companyIdentifier.rawValue).bytes
        let data = Data([bytes.0, bytes.1])
        
        return additionalData.reduce(data, { $0.0 + [$0.1] })
    }
    
}

    
    public init?(data: Data) {
        
        guard data.count >= type(of: self).minimumLength
            else { return nil }
        
        let companyIdentifier = CompanyIdentifier(rawValue: UInt16(littleEndian: UInt16(bytes: (data[0], data[1]))))
        
        var additionalData = Data()
        
        if data.count > type(of: self).minimumLength {
            
            additionalData = Data(data.suffix(from: 2))
            
        } else {
            
            additionalData = Data()
        }
        
        self.init(companyIdentifier: companyIdentifier, additionalData: additionalData)
