refactoring object sampler