     {late_executables, new} = do_checkup(all_events, now, state)
 
     unless Enum.empty?(late_executables) do
-      # Map over the events for logging. Both Sequences and Regimens have a `name` field.
+      # Map over the events for logging.
+      # Both Sequences and Regimens have a `name` field.
       names = Enum.map(late_executables, &Map.get(elem(&1, 0), :name))
       Logger.debug(3, "Time for events: #{inspect(names)} to be scheduled.")
       schedule_events(late_executables, now)
     end
 
-    exit({:success, %{new | events: Map.new(all_events, fn event -> {event.id, event} end)}})
+    exit(
+      {:success,
+       %{new | events: Map.new(all_events, fn event -> {event.id, event} end)}}
+    )
   end
 
   defp do_checkup(list, time, late_events \\ [], state)

    finished? = Timex.after?(now, end_time)

    case mod do
      Regimen -> maybe_schedule_regimen(scheduled?, schedule_time, last_time, executable, now)
      Sequence -> maybe_schedule_sequence(scheduled?, finished?, f, last_time, executable, now)
    end
  end

  defp maybe_schedule_regimen(scheduled?, schedule_time, last_time, executable, now)

  defp maybe_schedule_regimen(true = _scheduled?, schedule_time, nil, regimen, _now) do
    maybe_farm_event_log("regimen #{regimen.name} (#{regimen.id}) scheduling.")
    process_via = Farmbot.Regimen.NameProvider.via(regimen)
    pid = GenServer.whereis(process_via)
    if pid, do: {nil, schedule_time}, else: {regimen, schedule_time}
  end

  defp maybe_schedule_regimen(true = _scheduled?, _schedule_time, last_time, event, _now) do
    maybe_farm_event_log("regimen #{event.name} (#{event.id}) should already be scheduled.")
    {nil, last_time}
  end

  defp maybe_schedule_regimen(false = _scheduled?, schedule_time, last_time, event, _) do
    maybe_farm_event_log(
      "regimen #{event.name} (#{event.id}) is not scheduled yet. (#{inspect(schedule_time)}) (#{
        inspect(Timex.now())
      })"
    )

    {nil, last_time}
  end

  defp lookup!(module, %FarmEvent{executable_id: exe_id, id: id}) when is_atom(module) do
    case module do
      Sequence ->
        Asset.get_sequence_by_id!(exe_id)

    maybe_farm_event_log("Reindexed FarmEvents")

    if match?({_, _}, state.checkup) do
      Process.exit(
        state.checkup |> elem(0),
        {:success, %{state | events: events}}
      )
    end

    if state.timer do
