     ///
     /// - Parameter reloadViewControllers: Reload the view controllers data source for the PageboyViewController.
     internal func setUpPageViewController(reloadViewControllers: Bool = true) {
-        var existingZIndex: Int?
+        let existingZIndex: Int?
         if let pageViewController = self.pageViewController { // destroy existing page VC
-            existingZIndex = self.view.subviews.index(of: pageViewController.view)
-            self.pageViewController?.view.removeFromSuperview()
-            self.pageViewController?.removeFromParent()
-            self.pageViewController = nil
+            existingZIndex = view.subviews.index(of: pageViewController.view)
+            destroyCurrentPageViewController()
+        } else {
+            existingZIndex = nil
         }
         
         let pageViewController = UIPageViewController(transitionStyle: .scroll,
-                                                      navigationOrientation: self.navigationOrientation,
-                                                      options: convertToOptionalUIPageViewControllerOptionsKeyDictionary(self.pageViewControllerOptions))
+                                                      navigationOrientation: navigationOrientation,
+                                                      options: convertToOptionalUIPageViewControllerOptionsKeyDictionary(pageViewControllerOptions))
         pageViewController.delegate = self
         pageViewController.dataSource = self
         self.pageViewController = pageViewController

        pageViewController.scrollView?.isScrollEnabled = isScrollEnabled
        pageViewController.scrollView?.isUserInteractionEnabled = isUserInteractionEnabled
        
        self.reloadData(reloadViewControllers: reloadViewControllers)
    }
    
    /// Re-initialize the internal UIPageViewController instance without reloading data source if it currently exists.
    internal func reconfigurePageViewController() {
        guard self.pageViewController != nil else {
            return
        }
        self.setUpPageViewController(reloadViewControllers: false)
    }
    
    /// The options to be passed to a UIPageViewController instance.
    internal var pageViewControllerOptions: [String: Any]? {
        var options = [String: Any]()
        
        if self.interPageSpacing > 0.0 {
            options[convertFromUIPageViewControllerOptionsKey(UIPageViewController.OptionsKey.interPageSpacing)] = self.interPageSpacing
        }
        
        guard options.count > 0 else {

        pageViewController.didMove(toParent: self)
      
        // Add hidden scroll view that will be used to interact with navigation bar large titles.
        let invisibleScrollView = ParentMatchedScrollView.matching(parent: view)
        view.addSubview(invisibleScrollView)
        view.sendSubviewToBack(invisibleScrollView)
        self.invisibleScrollView = invisibleScrollView
