                 
                 guard pdu.handle == operation.lastRequest.handle,
                     pdu.offset == operation.lastRequest.offset,
-                    pdu.partValue == operation.lastRequest.partValue else {
-                        inLongWrite = false
-                        operation.completion(.error(GATTClientError.invalidResponse(pdu)))
-                        return
-                }
+                    pdu.partValue == operation.lastRequest.partValue
+                    else { complete { $0.completion(.error(GATTClientError.invalidResponse(pdu))) }; return }
             }
             
             let offset = operation.lastRequest.offset + UInt16(operation.lastRequest.partValue.count)
             
             // all data sent
-            guard offset < operation.data.count else {
-                inLongWrite = false
-                operation.success()
-                return
-            }
+            guard offset < operation.data.count
+                else { complete { $0.success() }; return }
             
             // write next part
             let length = connection.maximumTransmissionUnit - 5

     */
    private func prepareWrite(_ response: ATTResponse<ATTPrepareWriteResponse>, operation: WriteOperation) {
        
        switch response {
            
        case let .error(error):
            
            operation.error(error)
            
        case let .value(pdu):
            

            operation.lastRequest = pdu
            operation.sentData += attributeValuePart
            
            send(pdu) { [unowned self] in self.prepareWrite($0, operation: operation) }
        }
    }
