Manipulation of the heme electronic structure by external stimuli and ligand field