restructure data