continuation of comment on line holy monkeys  that is long file  should maybe be splitted in the future  but anyway  if this is setting instance topology to none and will not pass on the next conditional you can simply return it here no  try except exception numatopologynotfound suggestion  log something return