preprocessing cleanup