Finish preprocessing