more componentized design
fix incorrect arguments
Merge pull request #927 from dimagi/data_format

more componentized design