 
                         if let cell = cell as? ChatRightTextCell {
 
-                            let layoutCache = ChatTextCellLayoutCache(
-                                textContentTextViewWidth: textContentLabelWidthOfMessage(message),
-                                textContentTextViewFrame: textContentTextViewFrameOfMessage(message),
-                                update: { [weak self] textContentTextViewFrame in
-                                    self?.updateTextContentTextViewFrame(textContentTextViewFrame, forMessage: message)
-                                }
-                            )
+                            let layoutCache = chatTextCellLayoutCacheOfMessage(message)
 
                             cell.configureWithMessage(message, layoutCache: layoutCache, mediaTapAction: mediaTapAction)
 


                        if let cell = cell as? ChatRightTextURLCell {

                            let layoutCache = ChatTextCellLayoutCache(
                                textContentTextViewWidth: textContentLabelWidthOfMessage(message),
                                textContentTextViewFrame: textContentTextViewFrameOfMessage(message),
                                update: { [weak self] textContentTextViewFrame in
                                    self?.updateTextContentTextViewFrame(textContentTextViewFrame, forMessage: message)
                                }
                            )

                            cell.configureWithMessage(message, layoutCache: layoutCache, mediaTapAction: mediaTapAction)


            textContentTextViewFrames[key] = frame
        }
    }
    private func chatTextCellLayoutCacheOfMessage(message: Message) -> ChatTextCellLayoutCache {

        let layoutCache = ChatTextCellLayoutCache(
            textContentTextViewWidth: textContentLabelWidthOfMessage(message),
            textContentTextViewFrame: textContentTextViewFrameOfMessage(message),
            update: { [weak self] textContentTextViewFrame in
                self?.updateTextContentTextViewFrame(textContentTextViewFrame, forMessage: message)
            }
        )

        return layoutCache
    }

    private var audioPlayedDurations = [String: NSTimeInterval]()

