     }
     
     func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
-        guard let fromVC = transitionContext.viewControllerForKey(UITransitionContextFromViewControllerKey),
-            toVC = transitionContext.viewControllerForKey(UITransitionContextToViewControllerKey) else {
+        guard let containerView = transitionContext.containerView(),
+            fromView = transitionContext.viewForKey(UITransitionContextFromViewKey),
+            toView = transitionContext.viewForKey(UITransitionContextToViewKey) else {
                 return
-        }
-        
-        dismissTransition(transitionContext, toView: toVC.view, fromView: fromVC.view)
-    }
-}
-
-extension SimplePopAnimator {
-    private func dismissTransition(transitionContext: UIViewControllerContextTransitioning, toView: UIView, fromView: UIView) {
-        guard let containerView = transitionContext.containerView() else {
-            return
         }
         
         containerView.insertSubview(toView, belowSubview: fromView)

            transitionContext.completeTransition(true)
        }
    }
}

    }
    
    func animateTransition(transitionContext: UIViewControllerContextTransitioning) {
        guard let containerView = transitionContext.containerView(),
            fromView = transitionContext.viewForKey(UITransitionContextFromViewKey),
            toView = transitionContext.viewForKey(UITransitionContextToViewKey) else {
            return
        }
        
