anchor.diff:        N -> start;
         _ -> monitoring
       end,
  +  ?D({pre_stop, NextState}),
     {next_state, NextState, State#state{indicator = NewInd, node_counter = N - 1, active_nodes = lists:delete(Node, Nodes), passive_nodes = [Node | PassiveNodes]}};
   
   pre_stop({pool_enabled, Node}, #state{indicator = Ind, timer = Timer, node_activity = Activities} = State) ->
     Ref = make_ref(),
     erlang:send_after(Timer, self(), {stop, Ref}),
  +  ?D({pre_stop, stop}),
     {next_state, stop, State#state{indicator = Ind - 1, stop_ref = Ref, node_activity = maps:put(Node, true, Activities)}};
   
   pre_stop({pool_disabled, Node}, #state{indicator = Ind, node_counter = N, node_activity = Activities} = State)  when N == Ind + 1 ->
  +  ?D({pre_stop, monitoring}),
     {next_state, monitoring, State#state{indicator = Ind + 1, node_activity = maps:put(Node, false, Activities)}};
   
   pre_stop({pool_disabled, Node}, #state{indicator = Ind, timer = Timer, node_activity = Activities} = State) ->
  +  ?D({pre_stop, stop}),
     Ref = make_ref(),
     erlang:send_after(Timer, self(), {stop, Ref}),
     {next_state, stop, State#state{indicator = Ind + 1, stop_ref = Ref, node_activity = maps:put(Node, false, Activities)}};
   
   pre_stop(high_idle_time, State) ->
  +  ?D({pre_stop, monitoring}),
     {next_state, monitoring, State};
   
   pre_stop(_Event, State) ->
  
positive.code:   {next_state, monitoring, State#state{indicator = Indicator, node_counter = length(ActiveNodes), active_nodes = ActiveNodes, passive_nodes = PassiveNodes, node_to_id = NodeToId}};
  
  handle_info({stop, Ref}, stop, #state{active_nodes = [Node |_], node_to_id = NodeToId, stop_ref = Ref} = State) ->
    aws_cli:stop_instance(maps:get(Node, NodeToId)),
    {next_state, monitoring, State};
  
  handle_info({stop, _Ref}, pre_stop, #state{timer = Timer} = State) ->
    Ref = make_ref(),
    erlang:send_after(Timer, self(), {stop, Ref}),
    {next_state, stop, State#state{stop_ref = Ref}};
  
  handle_info({start, _Ref}, pre_stop, #state{timer = Timer} = State) ->
    Ref = make_ref(),
    erlang:send_after(Timer, self(), {stop, Ref}),
    {next_state, stop, State#state{stop_ref = Ref}};
  
  handle_info({start, Ref}, after_start, #state{start_ref = Ref} = State) ->
    {next_state, monitoring, State};
  
  handle_info(_Info, StateName, State) ->
  
negative.code:   {next_state, after_start, State#state{indicator = Ind + 1, node_activity = maps:put(Node, false, Activities)}};
  
  after_start({pool_connected, Node}, #state{node_counter = N, active_nodes = Nodes, passive_nodes = PassiveNodes, node_activity = Activities} = State) ->
    ?D({after_start, monitoring}),
    {next_state, monitoring, State#state{node_counter = N + 1, active_nodes = [Node | Nodes], passive_nodes = lists:delete(Node, PassiveNodes), node_activity = maps:put(Node, true, Activities)}};
  
  after_start({pool_down, Node}, #state{indicator = Ind, node_counter = N, active_nodes = Nodes, passive_nodes = PassiveNodes, node_activity = Activities} = State) ->
  