Make generate and fit functions use new data format.