         self.zoomScale = targetScale
         
         // Update Constraints
-        self.refreshLayout()
+        self.updateImageConstraints()
     }
-    
-    func refreshLayout() {
+
+    func updateImageConstraints() {
         guard self.image != nil else {
             return
         }
-        // Update Padding
+        // Calculate Padding
         let horizontalPadding = max(0, (self.frame.width - self.image!.size.width * self.zoomScale)/2)
         let verticalPadding = max(0, (self.frame.height - self.image!.size.height * self.zoomScale)/2)
         
+        // Update Constraints
         self.topConstraint.constant = verticalPadding
         self.bottomConstraint.constant = verticalPadding
         self.leftConstraint.constant = horizontalPadding

    }
    
    public func scrollViewDidZoom(scrollView: UIScrollView) {
        refreshLayout()
    }
}

        }
        
        // Update min/max scale
        if targetScale < self.minimumZoomScale {
            self.minimumZoomScale = targetScale
        } else if targetScale > self.maximumZoomScale {
            self.maximumZoomScale = targetScale
