The layer variable is set and open directly in the data when that line runs, so it is redundant to have it look in the object and reference the nif format data.