Break get_data() and get_hash() out of retrieve_data().