         case @handler.register_pin(pin_num) do
           :ok ->
             ConfigStorage.add_gpio_registry(pin_num, sequence_id)
-            new_state = %{state | registered: Map.put(state.registered, pin_num, sequence_id)}
+
+            new_state = %{
+              state
+              | registered: Map.put(state.registered, pin_num, sequence_id)
+            }
+
             {:reply, :ok, [{:gpio_registry, new_state.registered}], new_state}
-          {:error, _} = err -> {:reply, err, [], state}
+
+          {:error, _} = err ->
+            {:reply, err, [], state}
         end
-      _ -> {:reply, {:error, :already_registered}, [], state}
+
+      _ ->
+        {:reply, {:error, :already_registered}, [], state}
     end
-
   end
 
   def handle_call({:unregister_pin, pin_num}, _from, state) do
     case state.registered[pin_num] do
-      nil -> {:reply, {:error, :unregistered}, [], state}
+      nil ->
+        {:reply, {:error, :unregistered}, [], state}
+
       sequence_id ->
         case @handler.unregister_pin(pin_num) do
           :ok ->
             ConfigStorage.delete_gpio_registry(pin_num, sequence_id)
-            new_state = %{state | registered: Map.delete(state.registered, pin_num)}
+
+            new_state = %{
+              state
+              | registered: Map.delete(state.registered, pin_num)
+            }
+
             {:reply, :ok, [{:gpio_registry, new_state.registered}], new_state}
-          err -> {:reply, err, [], state}
+
+          err ->
+            {:reply, err, [], state}
         end
     end
   end

    rescue
      err ->
        message = Exception.message(err)
        Logger.warn 2, "Failed to execute sequence #{sequence_id} " <> message
        env
    end
  end

end


  defp do_execute(sequence_id, env) do
    import Farmbot.CeleryScript.AST.Node.Execute, only: [execute: 3]

    try do
      case execute(%{sequence_id: sequence_id}, [], env) do
        {:ok, env} -> env
