Update preprocessing code