Might add a function cluase here:

    expand(DbName) when is_binary(DbName); is_list(DbName) ->
        TargetNodes = allowed_nodes(fun(Zone) -> Zone =/= <<"decom">> end),
        expand(Db, TargetNodes, 1000).

for easy reuse of the TargetNodes bit.