Raw data preparation