Implement preprocess