optimized and corrected data prep for SDMs