     }
 
     func refreshMessages(completionHandler: (() -> Void)? = nil) {
-        if let token = userAuthenticationToken {
-            refreshMessages(token: token, completionHandler: completionHandler)
-        } else {
-            notifyDidFailToLoadMessages()
-            completionHandler?()
-        }
-    }
-    
-    private func refreshMessages(token: String, completionHandler: (() -> Void)?) {
-        api.loadPrivateMessages(authorizationToken: token) { (messages) in
-            if let messages = messages {
-                self.updateEntities(from: messages)
-            } else {
-                self.notifyDidFailToLoadMessages()
-            }
-
-            completionHandler?()
-        }
+        state.refreshMessages(completionHandler: completionHandler)
     }
     
     private func updateEntities(from messages: [MessageCharacteristics]) {

    }

    private func userLoggedIn(_ event: DomainEvent.LoggedIn) {
        userAuthenticationToken = event.authenticationToken
    }

}

    }
    
    private func notifyDidFailToLoadMessages() {
        observers.forEach({ $0.privateMessagesServiceDidFailToLoadMessages() })
    }

    private func updateObserversWithUnreadMessageCount() {
        let unreadCount = determineUnreadMessageCount()
        observers.forEach({ $0.privateMessagesServiceDidUpdateUnreadMessageCount(to: unreadCount) })
    }
    
    private func determineUnreadMessageCount() -> Int {
        return localMessages.filter({ $0.isRead == false }).count
    }
    
    private func makeMessage(from characteristics: MessageCharacteristics) -> MessageImpl {
