restructure data schema