Polymorphism to reuse the various init blocks and avoid significant duplications of code.  I couldn't figure out a way to do it with templates since the sampler isn't known at compile time.