better way to get the data in list