temp implementation of preprocess