get rid of lambda context object in preprocess