pulled common code out to load_data.R