 
     fileprivate func getOpacity(_ styleParts: [String: String]) -> Double {
         if let opacityAttr = styleParts["opacity"] {
-            return Double(opacityAttr.replacingOccurrences(of: " ", with: "")) ?? 1
+            return getOpacity(opacityAttr)
         }
         return 1
+    }
+
+    fileprivate func getOpacity(_ opacity: String) -> Double {
+        return Double(opacity.replacingOccurrences(of: " ", with: "")) ?? 1
     }
 
     fileprivate func parseLine(_ line: XMLIndexer) -> Line? {

        var result: Node?
        if let element = node.element {
            let style = getStyleAttributes(groupStyle, element: element)
            if style["display"] == "none" || style["visibility"] == "hidden" {
                return .none
            }
            switch element.name {

                }
            }
        }
        let layout = svgElement != nil ? try parseViewBox(svgElement!) : nil
        try parseSvg(parsedXml.children)
        let root = layout != nil ? SVGCanvas(layout: layout!, contents: nodes) : Group(contents: nodes)
        if let opacity = svgElement?.attribute(by: "opacity") {
            root.opacity = getOpacity(opacity.text)
        }
        return root
    }

    fileprivate func prepareSvg(_ children: [XMLIndexer]) throws {
