refactor preprocess files