preprocess files