refactor the data format