merged Yucheng's design for sampler fragment