work-in-progress subsampling refactoring