reorganize data structure