                   :dotted "1,1"
                   :dashed "10,10")]
       (-> attrs
-          (assoc :stroke-dasharray value)
-          (dissoc :stroke-type)))
+          (assoc! :stroke-dasharray value)
+          (dissoc! :stroke-type)))
     attrs))
 
-(defn- transform-attrs
-  [attrs]
-  (-> attrs
-      (transform-stroke-type)))
+(defn- extract-style-attrs
+  "Extract predefinet attrs from shapes."
+  [shape]
+  (let [attrs (select-keys shape +style-attrs+)]
+    (-> (transient attrs)
+        (transform-stroke-type)
+        (persistent!))))
 
 (defn- make-debug-attrs
   [shape]

;; Attribute transformations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn- extract-style-attrs
  "Extract predefinet attrs from shapes."
  [shape]
  (select-keys shape [:fill :opacity :stroke :stroke-opacity :stroke-width
                      :stroke-type]))

(defn- transform-stroke-type
  [attrs]

  (let [key (str id)
        props (select-keys shape [:x1 :x2 :y2 :y1])
        attrs (-> (extract-style-attrs shape)
                  (merge {:id key :key key})
                  (merge props))]
    (html
