Moved sampler setup to its own method