Add preprocessing functions