improve preprocessing