   
   public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
     
-    if let id = anim.value(forKey: "id") as? String, let anilayer = animationLayersDictionary[id] {
+    if let id = anim.value(forKey: "id") as? String, let aniview = animationViewsDictionary[id] {
       let components = id.components(separatedBy: ",")
       let index = Int(components[safe: 1] ?? "") ?? 0
       let item = AnimationItem(rawValue: components.first ?? "") ?? AnimationItem.oldCell
       
       if index != expandedItemIndex, item != .newRightSide {
-        anilayer.layer.removeFromSuperlayer()
+        aniview.view.removeFromSuperview()
       }
       
       switch item {
       case .oldRightSide:
         collectionView.isUserInteractionEnabled = true
         
-      case .newCell where index == expandedItemIndex && anilayer.animation.beginTime == anim.beginTime:
+      case .newCell where index == expandedItemIndex && aniview.animation.beginTime == anim.beginTime:
         let paths = collectionView.indexPathsForVisibleItems.sorted { $0.0.item < $0.1.item }
         guard let path = paths.first, let cell = collectionView.cellForItem(at: path) else {
           break
         }
         cell.alpha = 1
-        anilayer.layer.removeFromSuperlayer()
+        aniview.view.removeFromSuperview()
         
-      case .newRightSide where index == expandedItemIndex && anilayer.animation.beginTime == anim.beginTime:
+      case .newRightSide where index == expandedItemIndex && aniview.animation.beginTime == anim.beginTime:
         resetViews()
         animationInProcess = false
       default: break

    oldCellLayer.anchorPoint = up ? CGPoint(x: 0, y: 0) : CGPoint(x: 0, y: 1)
    oldCellLayer.position = up ? CGPoint(x: minX, y: cellFrame.minY) : CGPoint(x: minX, y: cellFrame.maxY)
    let oldCellNewBoundsValue = AnimationValue.bounds(oldCellNewBounds)
    animate(oldCellLayer, newValue: oldCellNewBoundsValue, item: .oldCell, delay: delay, index: index)
    
    // MARK: Animate old right cell off-screen
    let oldRightSideLayer = oldRightSideSnapshotView.layer
    oldRightSideLayer.anchorPoint = .zero
    oldRightSideLayer.position = CGPoint(x: cellFrame.maxX + space, y: 0)
    let oldRightSideNewPosition = CGPoint(x: bounds.width, y: 0)
    let oldRightSideNewValue = AnimationValue.position(oldRightSideNewPosition)
    animate(oldRightSideLayer, newValue: oldRightSideNewValue, item: .oldRightSide, index: index)
    
    // MARK: Animate buttons
    UIView.animate(withDuration: duration, delay: duration / 5, options: .curveEaseInOut, animations: {
      up ? self.animateBottomButtons() : self.animateTopButtons()
    }, completion: nil)
    

    let newCellWrapperLayer = newCellWrapperView.layer
    newCellWrapperLayer.anchorPoint = up ? CGPoint(x: 0, y: 1) : CGPoint(x: 0, y: 0)
    newCellWrapperLayer.position = up ? CGPoint(x: minX, y: cellFrame.maxY) : CGPoint(x: minX, y: cellFrame.minY)
    newCellWrapperLayer.bounds = .zero
    var newCellWrapperNewBounds = CGRect.zero
    newCellWrapperNewBounds.size = cellFrame.size
    let newCellWrapperNewBoundsValue = AnimationValue.bounds(newCellWrapperNewBounds)
    animate(newCellWrapperView, newValue: newCellWrapperNewBoundsValue, item: .newCellWrapper, delay: newCellAnimationDelay, index: index)
    
    // MARK: Animate cell snapshot
    let newCellSnapshotLayer = newCellSnapshotView.layer
