enhanced preprocessing