Pretreatment of metallic substrates