refactoring
some pieces of sampler pushed farther to completion