     }
     
     // MARK: Change page progressive direction
-    
+
+	private func transformViewForRTL(_ view: UIView?) {
+		if (self.readerContainer.folioReader.needsRTLChange == true) {
+			view?.transform = CGAffineTransform(scaleX: -1, y: 1)
+		} else {
+			view?.transform = CGAffineTransform.identity
+		}
+	}
+
     func setCollectionViewProgressiveDirection() {
-        if (self.readerContainer.folioReader.needsRTLChange == true) {
-            collectionView.transform = CGAffineTransform(scaleX: -1, y: 1)
-        } else {
-            collectionView.transform = CGAffineTransform.identity
-        }
+		self.transformViewForRTL(self.collectionView)
     }
     
     func setPageProgressiveDirection(_ page: FolioReaderPage) {
-        if (self.readerContainer.folioReader.needsRTLChange == true) {
-//            if page.transform.a == -1 { return }
-            page.transform = CGAffineTransform(scaleX: -1, y: 1)
-        } else {
-            page.transform = CGAffineTransform.identity
-        }
+		self.transformViewForRTL(page)
     }
 
     // MARK: Change layout orientation

		guard let currentPage = self.currentPage else {
			return
		}
		let pageScrollView = currentPage.webView.scrollView

		// Get internal page offset before layout change

        if (shouldHide == false) {
			self.configureNavBar()
		}

		self.updateBarsStatus(shouldHide)
    }

	private func updateBarsStatus(_ shouldHide: Bool, shouldShowIndicator: Bool = false) {

		self.readerContainer.shouldHideStatusBar = shouldHide

		UIView.animate(withDuration: 0.25, animations: {
			self.readerContainer.setNeedsStatusBarAppearanceUpdate()

			// Show minutes indicator
			if (shouldShowIndicator == true) {
				self.pageIndicatorView?.minutesLabel.alpha = (shouldHide == true ? 0 : 1)
			}
		})

		self.navigationController?.setNavigationBarHidden(shouldHide, animated: true)
	}

    // MARK: UICollectionViewDataSource

    open func numberOfSections(in collectionView: UICollectionView) -> Int {
        return 1
    }
