create directory preprocessing and move code into it