     }
     
     public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
-        ensureScrollViewIsActual(scrollView: scrollView, then: {
-            if self.autoScroller.cancelsOnScroll {
-                self.autoScroller.cancel()
-            }
-        })
+        guard scrollViewIsActual(scrollView) else {
+            return
+        }
+        if autoScroller.cancelsOnScroll {
+            autoScroller.cancel()
+        }
     }
     
     public func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
-        ensureScrollViewIsActual(scrollView: scrollView, then: {
-            self.scrollView(didEndScrolling: scrollView)
-        })
+        guard scrollViewIsActual(scrollView) else {
+            return
+        }
+        self.scrollView(didEndScrolling: scrollView)
     }
     
     public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
-        ensureScrollViewIsActual(scrollView: scrollView, then: {
-            self.scrollView(didEndScrolling: scrollView)
-        })
+        guard scrollViewIsActual(scrollView) else {
+            return
+        }
+        self.scrollView(didEndScrolling: scrollView)
     }
     
     public func scrollViewWillEndDragging(_ scrollView: UIScrollView,
                                           withVelocity velocity: CGPoint,
                                           targetContentOffset: UnsafeMutablePointer<CGPoint>) {
-        ensureScrollViewIsActual(scrollView: scrollView, then: {
-            self.updateContentOffsetForBounceIfNeeded(scrollView: scrollView)
-        })
+        guard scrollViewIsActual(scrollView) else {
+            return
+        }
+        
+        updateContentOffsetForBounceIfNeeded(scrollView: scrollView)
     }
     
     private func scrollView(didEndScrolling scrollView: UIScrollView) {
-        ensureScrollViewIsActual(scrollView: scrollView, then: {
-            if self.autoScroller.restartsOnScrollEnd {
-                self.autoScroller.restart()
-            }
-            self.expectedTransitionIndex = nil
-        })
-    }
-    
-    private func ensureScrollViewIsActual(scrollView: UIScrollView, then action: () -> Void) {
-        if scrollViewIsActual(scrollView) {
-            action()
-        }
+        guard scrollViewIsActual(scrollView) else {
+            return
+        }
+        
+        if autoScroller.restartsOnScrollEnd {
+            autoScroller.restart()
+        }
+        self.expectedTransitionIndex = nil
     }
 }
 

        guard scrollViewIsActual(scrollView) else {
            return
        }
        
        guard self.updateContentOffsetForBounceIfNeeded(scrollView: scrollView) == false else {
            return
        }
        

                                                             pageSize: pageSize) else {
                                                                return
        }
        guard var pagePosition = calculatePagePosition(for: contentOffset,
                                               pageSize: pageSize,
                                               indexDiff: scrollIndexDiff) else {
                                                return
        }
        
        // do not continue if a page change is detected
        let didDetectNewPage = detectNewPageIndexIfNeeded(pagePosition: pagePosition,
                                                          scrollView: scrollView)
        guard !didDetectNewPage else {
            return
        }
        
        // do not continue if previous position equals current
