moved data generation to controller