anchor.diff:  continue_alarm(Name, Secs, Pid, Epoch) ->
       msg_delay:send_local(Secs, Pid, {check_alarm, Name, Epoch}).
   
  +-spec update_alarm(dict(), atom(), {atom(), any()} | [{atom(), any()}]) -> dict().
   update_alarm(Alarms, Name, {Field, NewValue}) ->
       update_alarm(Alarms, Name, [{Field, NewValue}]);
   update_alarm(Alarms, Name, [{Field, NewValue}|Tail]) ->
  -    NewAlarms =
  -        case Field =:= epoch of
  -            true ->
  -                % update epoch
  -                dict:update(Name, fun({_Alarm, _Epoch}) -> {_Alarm, NewValue} end, Alarms);
  -            false ->
  -                % update record
  -                FieldIndex =
  -                    case Field of
  -                        period_secs   -> 4;
  -                        cooldown_secs -> 5;
  -                        lower_limit   -> 6;
  -                        upper_limit   -> 7;
  -                        scale_down_by -> 8;
  -                        scale_up_by   -> 9;
  -                        state         -> 10;
  -                        _             -> -1
  -                    end,
  -                dict:update(Name,
  -                            fun({Alarm, Epoch}) ->
  -                                {erlang:setelement(FieldIndex, Alarm, NewValue), Epoch}
  -                            end,
  -                            Alarms)
  -        end,
  +    UpdateFun = ?IIF(Field =:= epoch,
  +                     fun({_Alarm, _Epoch}) -> {_Alarm, NewValue} end,
  +                     fun({Alarm, Epoch}) -> {erlang:setelement(10, Alarm, NewValue), Epoch} end
  +                ),
  +    NewAlarms = dict:update(Name, UpdateFun, Alarms),
       update_alarm(NewAlarms, Name, Tail);
   update_alarm(Alarms, _Name, []) ->
       Alarms.
  
positive.code:         1 -> breach_upper;
          2 -> breach_lower;
          3 -> ok
      end;
  check_alarm(_, _) ->
      unknown_alarm_handler.
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % alarm helpers
  
negative.code:             % call alarm handler and react to breach_state 
              NextCheckSecs =
                  case check_alarm(Alarm#alarm.handler, Alarm) of
                      breach_lower ->
                          ?CLOUD:remove_vms(Alarm#alarm.vms_to_remove),
                          erlang:max(Alarm#alarm.check_interval_secs, Alarm#alarm.cooldown_secs);
  