anchor.diff:      [{Key, _B}] ->
         ets:delete(?MODULE, Key);
       _ -> true
  -  end,
  -  From ! {stopped_backend, Backend}.
  +  end.
   
   % turn the command string from the comand string with the values
   % of [[KEY]] replaced by the corresponding proplist element of
  
positive.code: stop_instance(Backend, App, From) ->
    gen_server:call(?SERVER, {stop_instance, Backend, App, From}).
  
  %%====================================================================
  %% gen_server callbacks
  %%====================================================================
  
negative.code: %%                                      {stop, Reason, State}
  %% Description: Handling cast messages
  %%--------------------------------------------------------------------
  % Good spot for optimization
  handle_cast({stop_app, App, From}, #state{current_backends = CurrBackends} = State) ->
    BackendOfApp = lists:filter(fun(Backend) -> Backend#backend.app_name =:= App#app.name end, CurrBackends),
    
    lists:map(fun(Backend) ->
      internal_stop_instance(Backend, App, From)
    end, BackendOfApp),
    
    NewBackends = lists:subtract(CurrBackends, BackendOfApp),
    NewAvailablePorts = lists:map(fun(B) -> B#backend.port end, NewBackends),
    {noreply, State#state{current_backends = NewBackends, available_ports = NewAvailablePorts}};
    
  handle_cast(_Msg, State) ->
    {noreply, State}.
  
  