- preprocess input