         chatView.collectionView.delegate = self
         chatView.collectionView.dataSource = self
         
-        ChatOtherMessageCell.register(in: chatView.collectionView)
-        ChatMyMessageCell.register(in: chatView.collectionView)
+        ChatMessageCell.register(in: chatView.collectionView)
         
-        otherMessageCellPrototype.frame.size.width = size.width
-        myMessageCellPrototype.frame.size.width = size.width
+        messageCellPrototype.frame.size.width = size.width
         
         view = chatView
     }


    var chatView: ChatView!
    
    lazy var otherMessageCellPrototype = ChatOtherMessageCell()
    lazy var myMessageCellPrototype = ChatMyMessageCell()
    lazy var messages: [ChatDisplayData] = generateRandomChatDisplayItems()
    
    override func loadView() {

extension ChatViewController: UICollectionViewDelegateFlowLayout {
    
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        let item = messages[indexPath.row] as? ChatMessageCellItem
        messageCellPrototype.configure(item)
        
        let width = collectionView.frame.width
        let height = messageCellPrototype.messageLabel.frame.maxY
        
        return CGSize(width: width, height: height)
    }
    
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
