simplify data preparation, decouple it from controler