     func browser(browser: MCNearbyServiceBrowser, lostPeer peerID: MCPeerID) {
         do {
             let peerIdentifier = try PeerIdentifier(mcPeer: peerID)
-            didLosePeer(peerIdentifier)
+            didLosePeerHandler(peerIdentifier)
         } catch let error {
             print("cannot parse identifier \"\(peerID.displayName)\" because of error: \(error)")
         }


final class Browser: NSObject {
    private let browser: MCNearbyServiceBrowser
    private let didFindPeer: (PeerIdentifier) -> Void
    private let didLosePeer: (PeerIdentifier) -> Void
    var didChangeListeningHandler: ((Bool) -> Void)?
    internal private(set) var listening: Bool = false {
        didSet {

                        foundPeer peerID: MCPeerID, withDiscoveryInfo info: [String : String]?) {
        do {
            let peerIdentifier = try PeerIdentifier(mcPeer: peerID)
            didFindPeerHandler(peerIdentifier)
        } catch let error {
            print("cannot parse identifier \"\(peerID.displayName)\" because of error: \(error)")
        }
