improved API for setting preprocess context