Pre-processing work