     }
   end
 
-  defp create_tasks(projects, tasks, create_task_function) do
+  defp create_tasks(projects, tasks, type) do
 
     conflicts = MapSet.intersection(
       MapSet.new(projects), 

    end
  end

  defp start_reindex_processes(projects) do
    start_processes(projects, :reindex, fn project -> Task.Supervisor.async_nolink(
        IndexingSupervisor, Indexer, :reindex, [project]) end) 
  end

  defp start_tilegen_processes(projects) do
    start_processes(projects, :tilegen, fn project -> Task.Supervisor.async_nolink(
        IndexingSupervisor, TilesController, :make_tiles, [[project]]) end) # TODO review params 
  end

  defp start_convert_processes(projects) do
    start_processes(projects, :convert, fn project -> Task.Supervisor.async_nolink(
      IndexingSupervisor, ConversionController, :convert, [project]) end) 
  end

  defp start_processes(projects, type, start_function) do
    for project <- projects, into: %{} do
      { 
        project,
        %{ task: start_function.(project), type: type}
      }
    end
  end

  defp display(tasks) do

  # TODO handle projects not found, with :reindex and :stop_reindex
  @impl true
  def handle_call({:reindex, projects}, _from, tasks) do
    create_tasks(projects, tasks, :reindex)
  end
  def handle_call({:tilegen, projects}, _from, tasks) do
    create_tasks(projects, tasks, :tilegen)
  end
  def handle_call({:convert, projects}, _from, tasks) do
    create_tasks(projects, tasks, :convert)
  end
  def handle_call({:show_tasks}, _from, tasks) do
    {
