restructure sampling process