index references when writing model