 
     public override func viewDidLoad() {
         super.viewDidLoad()
-        
-        masterContainer = UIView(frame: CGRectZero)
-        detailContainer = UIView(frame: CGRectZero)
-        masterContainer!.translatesAutoresizingMaskIntoConstraints = false
-        detailContainer!.translatesAutoresizingMaskIntoConstraints = false
-        view.addSubview(masterContainer!)
-        view.addSubview(detailContainer!)
-        updateFrames()
-        
-        addChild(masterViewController, containerView: masterContainer)
-        addChild(detailViewController, containerView: detailContainer)
+
+        let frames = containerFrames
+        addChild(masterViewController, withFrame: frames.master)
+        addChild(detailViewController, withFrame: frames.detail)
     }
     
     public override func viewWillAppear(animated: Bool) {

    }
    
    public func overlayMasterViewController() {
        guard masterPresentationStyle == .Hidden, let detailContainer = detailContainer else {
            return
        }
        
        let button = UIButton(type: .Custom)
        button.translatesAutoresizingMaskIntoConstraints = true
        button.frame = detailContainer.bounds
        button.addTarget(self, action: Selector("overlayHideButtonTapped"), forControlEvents: .TouchUpInside)
        detailContainer.addSubview(button)

        overlayHideButton = button
        masterPresentationStyle = .Overlay

            removeChild(masterViewController)
        }
        didSet {
            addChild(masterViewController, withFrame: containerFrames.master)
        }
    }
    
