No need to use isDefined and get here:

case (_, mapping, Some(link), Some(index) =>