anchor.diff:                     version = 0,
                      aux     = empty,
                      timeout = new_timeout()},
  -    ContentCheck = is_valid_merge_step4(OldEpoch, OldVersion),
  +    ContentCheck = generic_content_check(L2, New, merge_step4),
       DB = get_db_for_id(Id),
       Self = comm:reply_as(self(), 5, {l_on_cseq, merge_reply_step4, L1, ReplyTo, '_'}),
       rbrcseq:qwrite(DB, Self, Id,
  
positive.code:                     {true, null}
              end
      end.
  %
  %    fun (Current, _WriteFilter, Next) ->
  %            log:log("is_valid_takeover~n~w~n~w~n", [Current, Next]),
  %            Res = standard_check(Current, Next, Epoch, Version)
  %            %% checks for debugging
  %                andalso (Current#lease.epoch+1 == Next#lease.epoch)
  %                andalso (Next#lease.owner == comm:make_global(pid_groups:get_my(dht_node)))
  %                andalso (Current#lease.owner =/= Next#lease.owner)
  %                andalso (Current#lease.range == Next#lease.range)
  %                andalso (Current#lease.aux == Next#lease.aux)
  %                andalso (Current#lease.timeout < Next#lease.timeout)
  %                andalso (os:timestamp() <  Next#lease.timeout)
  %                andalso not is_valid(Current), % Current has to be invalid!
  %            {Res, null}
  %    end.
  
  -spec is_valid_merge_step1(non_neg_integer(), non_neg_integer()) ->
      fun ((any(), any(), any()) -> {boolean(), null}). %% content check
  is_valid_merge_step1(Epoch, Version) ->
      fun (Current, _WriteFilter, Next) ->
              Res = standard_check(Current, Next, Epoch, Version)
              %% checks for debugging
                  andalso (Current#lease.epoch+1 == Next#lease.epoch)
                  andalso (Current#lease.owner == Next#lease.owner)
                  andalso (Current#lease.range == Next#lease.range)
                  andalso (Current#lease.aux =/= Next#lease.aux)
                  andalso (Current#lease.timeout < Next#lease.timeout)
                  andalso (os:timestamp() <  Next#lease.timeout),
              {Res, null}
      end.
  
  -spec is_valid_merge_step2(non_neg_integer(), non_neg_integer()) ->
      fun ((any(), any(), any()) -> {boolean(), null}). %% content check
  is_valid_merge_step2(Epoch, Version) ->
      fun (Current, _WriteFilter, Next) ->
              Res = standard_check(Current, Next, Epoch, Version)
              %% checks for debugging
                  andalso (Current#lease.epoch+1 == Next#lease.epoch)
                  andalso (Current#lease.owner == Next#lease.owner)
                  andalso (Current#lease.range =/= Next#lease.range)
                  andalso (Current#lease.aux =/= Next#lease.aux)
                  andalso (Current#lease.timeout < Next#lease.timeout)
                  andalso (os:timestamp() <  Next#lease.timeout),
              {Res, null}
      end.
  
  -spec is_valid_merge_step3(non_neg_integer(), non_neg_integer()) ->
      fun ((any(), any(), any()) -> {boolean, null}). %% content check
  is_valid_merge_step3(Epoch, Version) ->
      fun (Current, _WriteFilter, Next) ->
              Res = standard_check(Current, Next, Epoch, Version)
              %% checks for debugging
                  andalso (Current#lease.epoch+1 == Next#lease.epoch)
                  andalso (Current#lease.owner == Next#lease.owner)
                  andalso (Current#lease.range == Next#lease.range)
                  andalso (Current#lease.aux =/= Next#lease.aux)
                  andalso (Current#lease.timeout == Next#lease.timeout),
              {Res, null}
      end.
  
  -spec is_valid_merge_step4(non_neg_integer(), non_neg_integer()) ->
      fun ((any(), any(), any()) -> {boolean(), null}). %% content check
  is_valid_merge_step4(Epoch, Version) ->
      fun (Current, _WriteFilter, Next) ->
              Res = standard_check(Current, Next, Epoch, Version)
              %% checks for debugging
                  andalso (Current#lease.epoch+1 == Next#lease.epoch)
                  andalso (Current#lease.owner == Next#lease.owner)
                  andalso (Current#lease.range == Next#lease.range)
                  andalso (Next#lease.aux == empty)
                  andalso (Current#lease.aux =/= Next#lease.aux)
                  andalso (Current#lease.timeout =/= Next#lease.timeout)
                  andalso (os:timestamp() <  Next#lease.timeout),
              {Res, null}
      end.
  
  -spec is_valid_split_step1() ->
      fun ((any(), any(), any()) -> {boolean(), split_step1_failed_reason() | null}). %% content check
  
negative.code:                     version = 0,
                      aux     = {invalid, merge, get_range(L1), get_range(L2)},
                      timeout = new_timeout()},
      ContentCheck = generic_content_check(L1, New, merge_step1),
      DB = get_db_for_id(Id),
      Self = comm:reply_as(self(), 5, {l_on_cseq, merge_reply_step1, L2, ReplyTo, '_'}),
      rbrcseq:qwrite(DB, Self, Id,
  