Cleaned preprocessing step