Refactor SampleSet class