pulling the right type of data from db and then storing it