         
         // add queued write
         let preparedWrite = PreparedWrite(handle: pdu.handle, value: pdu.partValue, offset: pdu.offset)
-        
         preparedWrites.append(preparedWrite)
-        
         let response = ATTPrepareWriteResponse(handle: pdu.handle, offset: pdu.offset, partValue: pdu.partValue)
-        
-        respond(response)
-    }
-    
-    private func executeWriteRequest(_ pdu: ATTExecuteWriteRequest) {
-        
+        await respond(response)
+    }
+    
+    private func executeWriteRequest(_ pdu: ATTExecuteWriteRequest) async {
         let opcode = type(of: pdu).attributeOpcode
-        
         log?("Execute Write Request (\(pdu))")
-        
         let preparedWrites = self.preparedWrites
         self.preparedWrites = []
-        
         var newValues = [UInt16: Data]()
-        
         switch pdu {
-            
         case .cancel:
-            
             break // queue always cleared
-            
         case .write:
-            
             // validate
             for write in preparedWrites {
-                
                 let previousValue = newValues[write.handle] ?? Data()
-                
                 let newValue = previousValue + write.value
-                
                 // validate offset?
                 newValues[write.handle] = newValue
             }
-            
             // validate new values
             for (handle, newValue) in newValues {
-                
                 let attribute = database[handle: handle]
-                
                 // validate application errors with write callback
                 if let error = willWrite?(attribute.uuid, handle, attribute.value, newValue) {
-                    
-                    errorResponse(opcode, error, handle)
+                    await errorResponse(opcode, error, handle)
                     return
                 }
             }
-            
             // write new values
             for (handle, newValue) in newValues {
-                
                 database.write(newValue, forAttribute: handle)
             }
         }
         
-        respond(ATTExecuteWriteResponse())
-        
+        await respond(ATTExecuteWriteResponse())
         for handle in newValues.keys {
-            
-            didWriteAttribute(handle)
+            await didWriteAttribute(handle)
         }
     }
 }
 
 // MARK: - Supporting Types
 
-private extension GATTServer {
+internal extension GATTServer {
     
     struct PreparedWrite {
         

    }
    
    /// Handler for Write Request and Command
    private func handleWriteRequest(opcode: ATTOpcode, handle: UInt16, value: Data, shouldRespond: Bool) {
        
        /// Conditionally respond
        @inline(__always)
        func doResponse( _ block: @autoclosure() -> ()) {
            
            if shouldRespond { block() }
        }
        
        log?("Write \(shouldRespond ? "Request" : "Command") (\(handle)) \(value)")
        
        // no attributes, impossible to write
        guard database.attributes.isEmpty == false
            else { doResponse(errorResponse(opcode, .invalidHandle, handle)); return }
        
        // validate handle
        guard database.contains(handle: handle)
            else { errorResponse(opcode, .invalidHandle, handle); return }
        
        // get attribute
        let attribute = database[handle: handle]
        
        // validate permissions
        if let error = await checkPermissions([.write, .writeAuthentication, .writeEncrypt], attribute) {
            
            doResponse(errorResponse(opcode, error, handle))
            return
        }
        
        // validate application errors with write callback
        if let error = willWrite?(attribute.uuid, handle, attribute.value, value) {
            
            doResponse(errorResponse(opcode, error, handle))
            return
        }
        
        database.write(value, forAttribute: handle)
        
        doResponse(respond(ATTWriteResponse()))
        
        didWriteAttribute(handle)
    }
    
    private func didWriteAttribute(_ attributeHandle: UInt16, isLocalWrite: Bool = false) {
        
        let (group, attribute) = database.attributeGroup(for: attributeHandle)
        assert(attribute.handle == attributeHandle)

        assert(response.dataLength <= mtu,
               "Response \(response.dataLength) bytes > MTU (\(mtu))")
        
        await respond(response)
    }
    
    private func findInformation(_ pdu: ATTFindInformationRequest) async {
        
        typealias AttributeData = ATTFindInformationResponse.AttributeData
        
