Optimizing optical properties of reactively sputtered titanium nitride films