 // MARK: Setup & view updating
 ////////////////////////////////////////////////////////////////////
     
-    private func setup() {
+    func setup() {
+        setupViews()
+        setupAnimator()
+        setupGestureRecognition()
+    }
+    
+    func setupViews(){
+        internalView1.frame = self.bounds
+        internalView2.frame = self.bounds
+        
+        addSubview(internalView2)
+        addSubview(internalView1)
+        
+        internalView1.translatesAutoresizingMaskIntoConstraints = true
+        internalView2.translatesAutoresizingMaskIntoConstraints = true
+        
+        currentTopView = internalView1
+        currentBottomView = internalView2
+    }
+    
+    func setupAnimator(){
         animator = UIDynamicAnimator(referenceView: self)
         animator.delegate = self
-
-        internalView1.frame = self.bounds
-        internalView2.frame = self.bounds
-        
-        addSubview(internalView2)
-        addSubview(internalView1)
-        
-        internalView1.translatesAutoresizingMaskIntoConstraints = true
-        internalView2.translatesAutoresizingMaskIntoConstraints = true
-        
-        currentTopView = internalView1
-        currentBottomView = internalView2
-        
+    }
+    
+    func setupGestureRecognition(){
         panGestureRecognizer.delegate = self
         panGestureRecognizer.addTarget(self, action: "detectedPanGesture:")
-        
         addGestureRecognizer(panGestureRecognizer)
-        
         multipleTouchEnabled = false
     }
     
     override public func layoutSubviews() {
         
         super.layoutSubviews()
+        layoutSwitchableViews()
+    }
+    
+    func layoutSwitchableViews(){
         currentBottomView.frame = self.bounds
         currentBottomItemView?.frame = self.bounds
         

    public var viewsDisappearImmediately : Bool = true
    
    // Index for currently visible view. Indexing is refreshed with a call to reloadData.
    private(set) public var currentIndex : UInt = 0
    
    // Number of items (since the last reload, not the current number of items left for swiping)
    private(set) public var numberOfItems : UInt = 0

    // Currently visible view.
    public var currentItemView : UIView? {

                    }
                }
                
                itemBehavior!.addLinearVelocity(CGPointMake(velocity.x*2, velocity.y*2), forItem: swipeableView)
                animator.addBehavior(itemBehavior!)
                
                delegate?.swipeRevealGallery?(self, willAnimateItemAtIndex: currentIndex, away: true)
                
            } else {
                UIView.animateWithDuration(0.3, delay: 0, options: .CurveEaseInOut, animations: {
                    swipeableView.center = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2)
                    swipeableView.transform = CGAffineTransformIdentity
                    }, completion: {(finished : Bool) -> Void in
                        swipeableView.userInteractionEnabled = true
                        self.isAnimating = false
                        self.delegate?.swipeRevealGallery?(self, didEndAnimatingItemAtIndex: self.currentIndex, away: false)
                })
