better handling of data to retrieve and send