code cleanup Resample Operation