     }
 
     /**
-     Sort the data list based on data and cache it in a local variable.
-     */
-    internal func cacheDataSorted() {
-        dataSorted = data.sorted { (section1, section2) -> Bool in
-            guard
-                let object1 = section1.object.base as? MessageSectionModel,
-                let object2 = section2.object.base as? MessageSectionModel
-            else {
-                return false
-            }
-
-            return object1.messageDate.compare(object2.messageDate) == .orderedDescending
-        }
-
-        normalizeDataSorted()
-    }
-
-    /**
-     */
-    internal func normalizeDataSorted() {
-        let dataSortedMaxIndex = dataSorted.count - 1
-
-        for (idx, object) in dataSorted.enumerated() {
-            guard
-                idx < dataSortedMaxIndex,
-                var messageSection1 = object.object.base as? MessageSectionModel,
-                let messageSection2 = dataSorted[idx + 1].object.base as? MessageSectionModel
-            else {
-                continue
-            }
-
-            let message = messageSection1.message
-            let previousMessage = messageSection2.message
-
-            messageSection1.isSequential = isSequential(message: message, previousMessage: previousMessage)
-            messageSection1.daySeparator = daySeparator(message: message, previousMessage: previousMessage)
-
-            dataSorted[idx] = AnyChatSection(MessageSection(
-                object: AnyDifferentiable(messageSection1),
-                controllerContext: controllerContext
-            ))
-        }
-    }
-
-    /**
      This method is called on every update the messagesQuery get from Realm.
     */
     internal func handleDataUpdates(changes: RealmCollectionChange<Results<Message>>) {

    // MARK: Data Manipulation

    /**
     Returns if the message object is the first message of a day, and in this case
     returns the instance of the date. This is used in order to add the date separator
     in the list of messages.

        let date = message.createdAt
        let prevDate = previousMessage.createdAt

        let sameUser = message.userIdentifier == previousMessage.userIdentifier

        var timeLimit = AuthSettingsDefaults.messageGroupingPeriod
        if let settings = AuthSettingsManager.settings {
