 public extension BayaLayoutable {
     func layoutFlexibleContent(
         orientation: BayaLayoutOptions.Orientation,
-        before: BayaLayoutable?,
-        after: BayaLayoutable?,
+        before: BayaLayoutable? = nil,
+        after: BayaLayoutable? = nil,
         spacing: Int = 0,
         layoutMargins: UIEdgeInsets = UIEdgeInsets.zero)
             -> FlexibleContentLayout {

        if measures.after == nil {
            measures.after = elements.after?.sizeThatFitsWithMargins(frame.size)
        }
        if measures.content == nil {
            measures.content = elements.content.sizeThatFitsWithMargins(frame.size)
        }

        switch orientation {

            let relevantAfterWidth = afterWithMargins?.width.add(spacing) ?? 0
            let availableWidth = max(size.width - relevantBeforeWidth - relevantAfterWidth, 0)
            measures.content = elements.content.sizeThatFitsWithMargins(CGSize(width: availableWidth, height: size.height))
            let contentWithMargins = measures.content!.addMargins(ofElement: elements.content)
            return CGSize(
                width: relevantBeforeWidth + relevantAfterWidth + contentWithMargins.width,
                height: max(beforeWithMargins?.height ?? 0, afterWithMargins?.height ?? 0, contentWithMargins.height))

        case .vertical:
            let relevantBeforeHeight = beforeWithMargins?.height.add(spacing) ?? 0
            let relevantAfterHeight = afterWithMargins?.height.add(spacing) ?? 0
            let availableHeight = max(size.width - relevantBeforeHeight - relevantAfterHeight, 0)
            measures.content = elements.content.sizeThatFitsWithMargins(CGSize(width: size.width, height: availableHeight))
            let contentWithMargins = measures.content!.addMargins(ofElement: elements.content)
            return CGSize(
                width: max(beforeWithMargins?.width ?? 0, afterWithMargins?.width ?? 0, contentWithMargins.width),
                height: relevantBeforeHeight + relevantAfterHeight + contentWithMargins.height)
        }
    }
}
