I think the make_ref() needs to be within the fun()'s context to trigger selective receive optimization in the beam's runtime.