Wrap preprocessing code in a pipeline