preprocess stuff