                             var indexPathModifications: [Int] = []
 
                             for modified in modifications {
-                                if messagesCount < modified + 1 {
-                                    continue
-                                }
+                                guard modified < messagesCount else { continue }
 
                                 let message = Message(value: self.messagesQuery[modified])
                                 let identifier = message.identifier

                return
            }

            if insertions.count > 0 {
                var newMessages: [Message] = []
                for insertion in insertions {
                    let newMessage = Message(value: self.messagesQuery[insertion])
                    newMessages.append(newMessage)
                }

                return
            }

            if modifications.count > 0 {
                DispatchQueue.main.async {
                    let isAtBottom = self.chatLogIsAtBottom()
