Using combination of electrical measurements and internal photoemission interface barrier characterization the effective workfunction (EWF) changes of nm-thin TiN layer deposited on top of oxide insulators (SiO2, HfO2) have been correlated with atomic and chemical composition of the metal/oxide interfaces characterized by photoelectron spectroscopy and X-ray absorption.The major mechanisms of the EWF tuning are shown to be correlated to re-distribution of light N and O atoms. Oxygen scavenging from the underlying changes the TiN EWF by forming Ti oxynitride layer at the interface and introducing charge traps in the near-interface oxide layer.By contrast, significant (≈1 eV) reduction of EWF ban be achieved by introduction of a thin TiAl getter layer on top of TiN film. The mechanism of this reduction can be traced down to formation of metallic Ti caused by nitrogen scavenging by TiAl as evidenced by AlN formation.