             return nil
         }
 
-        if let index = self.currentIndex {
+        if let index = currentIndex {
             if index != 0 {
                 return self.viewController(at: index - 1)
-            } else if self.isInfiniteScrollEnabled {
+            } else if isInfiniteScrollEnabled {
                 return self.viewController(at: viewControllerCount - 1)
             }
         }

        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 {

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