move logic that handles the "to" parameter into normalize_stage_keys