Refactor #retrieve_data to include .map transformation