Extend and reuse functions in SampleUtil