                        (str "Service update failed. Reason: " (:error response))))})))
 
 (defn- init-state
-  [item]
-  (state/set-value (select-keys item [:registry :repository :version :serviceName :mode :replicas]) settings/cursor)
-  (state/set-value (:ports item) ports/cursor)
-  (state/set-value (:networks item) networks/cursor)
-  (state/set-value (:mounts item) mounts/cursor)
-  (state/set-value (:secrets item) secrets/cursor)
-  (state/set-value (:variables item) variables/cursor)
-  (state/set-value (:labels item) labels/cursor)
-  (state/set-value (:deployment item) deployment/cursor))
+  [service networks]
+  (state/set-value (select-keys service [:registry :repository :version :serviceName :mode :replicas]) settings/cursor)
+  (state/set-value (:ports service) ports/cursor)
+  (state/set-value (->> networks
+                        (map #(select-keys % [:networkName]))
+                        (into [])) networks/cursor)
+  (state/set-value (:mounts service) mounts/cursor)
+  (state/set-value (:secrets service) secrets/cursor)
+  (state/set-value (:variables service) variables/cursor)
+  (state/set-value (:labels service) labels/cursor)
+  (state/set-value (:deployment service) deployment/cursor))
 
 (def init-state-mixin
   (mixin/init
-    (fn [{:keys [service]}]
-      (init-state service))))
+    (fn [{:keys [service networks]}]
+      (init-state service networks)
+      (mounts/volumes-handler)
+      (networks/networks-handler)
+      (secrets/secrets-handler)
+      (placement/placement-handler))))
+
+(rum/defc form-settings < rum/static []
+  [:div.form-service-edit-group
+   (comp/form-section "General settings")
+   (settings/form true)])
+
+(rum/defc form-ports < rum/static []
+  [:div.form-service-edit-group.form-service-group-border
+   (comp/form-section-add "Ports" ports/add-item)
+   (ports/form-update)])
+
+(rum/defc form-networks < rum/static []
+  [:div.form-service-edit-group.form-service-group-border
+   (comp/form-section-add "Networks" networks/add-item)
+   (networks/form-update)])
+
+(rum/defc form-mounts < rum/static []
+  [:div.form-service-edit-group.form-service-group-border
+   (comp/form-section-add "Mounts" mounts/add-item)
+   (mounts/form-update)])
+
+(rum/defc form-secrets < rum/static []
+  [:div.form-service-edit-group.form-service-group-border
+   (if (empty? @secrets/secrets)
+     (comp/form-section "Secrets")
+     (comp/form-section-add "Secrets" secrets/add-item))
+   (secrets/form-update)])
+
+(rum/defc form-variables < rum/static []
+  [:div.form-service-edit-group.form-service-group-border
+   (comp/form-section-add "Environment variables" variables/add-item)
+   (variables/form-update)])
+
+(rum/defc form-labels < rum/static []
+  [:div.form-service-edit-group.form-service-group-border
+   (comp/form-section-add "Labels" labels/add-item)
+   (labels/form-update)])
+
+(rum/defc form-deployment < rum/static []
+  [:div.form-service-edit-group.form-service-group-border
+   (comp/form-section "Deployment")
+   (deployment/form)])
 
 (rum/defc form < rum/static
                  init-state-mixin [data]
-  (let [{:keys [secrets volumes placement service]} data]
+  (let [{:keys [service]} data]
     [:div
      [:div.form-panel
       [:div.form-panel-left

            [swarmpit.component.service.form-variables :as variables]
            [swarmpit.component.service.form-labels :as labels]
            [swarmpit.component.service.form-deployment :as deployment]
            [swarmpit.component.message :as message]
            [swarmpit.routes :as routes]
            [rum.core :as rum]))

           {:href  (routes/path-for-frontend :service-info (select-keys service [:id]))
            :label "Back"}))]]
     [:div.form-service-edit
      (form-settings)
      (form-ports)
      (form-networks)
      (form-mounts)
      (form-secrets)
      (form-variables)
      (form-labels)
      (form-deployment)]]))