Performance improvement on pre-processing