aggregate/clean data for training