         
         // If cell contains a bubble background, add the timestamp inside of it
         if let bubbleBackgroundView = cell.messageBubbleBackgroundView, bubbleBackgroundView.isHidden == false, let timestampLabel = self.createTimestampLabel(for: cellData) {
-
-            timestampLabel.translatesAutoresizingMaskIntoConstraints = false
-
-            cell.addTemporarySubview(timestampLabel)
-
-            bubbleBackgroundView.addSubview(timestampLabel)
-
-            let rightMargin: CGFloat = 8.0
-            let bottomMargin: CGFloat = 4.0
-
-            let trailingConstraint = timestampLabel.trailingAnchor.constraint(equalTo: bubbleBackgroundView.trailingAnchor, constant: -rightMargin)
-
-            let bottomConstraint = timestampLabel.bottomAnchor.constraint(equalTo: bubbleBackgroundView.bottomAnchor, constant: -bottomMargin)
-
-            NSLayoutConstraint.activate([
-                trailingConstraint,
-                bottomConstraint
-            ])
+            
+            self.addTimestampLabel(timestampLabel,
+                                   to: cell,
+                                   on: bubbleBackgroundView,
+                                   constrainingView: bubbleBackgroundView)
+            
         } else if cellData.isAttachmentWithThumbnail {
                                                  
             if cellData.attachment?.type == .sticker {

            } else if let attachmentView = cell.attachmentView, let timestampLabel = self.createTimestampLabel(for: cellData, textColor: self.theme.baseIconPrimaryColor) {
                // For media with thumbnail cells, add timestamp inside thumbnail
                
                timestampLabel.translatesAutoresizingMaskIntoConstraints = false

                cell.addTemporarySubview(timestampLabel)
                
                let cellContentView = cell.contentView
                
                cellContentView.addSubview(timestampLabel)

                let rightMargin: CGFloat = 8.0
                let bottomMargin: CGFloat = 4.0

                let trailingConstraint = timestampLabel.trailingAnchor.constraint(equalTo: attachmentView.trailingAnchor, constant: -rightMargin)

                let bottomConstraint = timestampLabel.bottomAnchor.constraint(equalTo: attachmentView.bottomAnchor, constant: -bottomMargin)

                NSLayoutConstraint.activate([
                    trailingConstraint,
                    bottomConstraint
                ])
            } else {
                super.addTimestampLabel(toCell: cell, cellData: cellData)
            }
        } else {
            super.addTimestampLabel(toCell: cell, cellData: cellData)
        }

        
        return false
    }
    
    private func addTimestampLabel(_ timestampLabel: UILabel,
                           to cell: MXKRoomBubbleTableViewCell,
                           on containerView: UIView,
                           constrainingView: UIView) {
        timestampLabel.translatesAutoresizingMaskIntoConstraints = false

        cell.addTemporarySubview(timestampLabel)
                
        containerView.addSubview(timestampLabel)

        let rightMargin: CGFloat = 8.0
        let bottomMargin: CGFloat = 4.0

        let trailingConstraint = timestampLabel.trailingAnchor.constraint(equalTo: constrainingView.trailingAnchor, constant: -rightMargin)

        let bottomConstraint = timestampLabel.bottomAnchor.constraint(equalTo: constrainingView.bottomAnchor, constant: -bottomMargin)

        NSLayoutConstraint.activate([
            trailingConstraint,
            bottomConstraint
        ])
    }
}
