A method includes spin-coating a first metal-free layer over the substrate, depositing a metal-containing layer over the first metal-free layer, spin-coating a second metal-free layer over the first metal-containing layer, forming a photoresist layer over the second metal-free layer, the photoresist layer including a first metallic element, exposing the photoresist layer, and subsequently developing the photoresist layer to form a pattern. The metal-containing layer includes a second metallic element selected from zirconium, tin, lanthanum, or manganese, and the first metallic element is selected from zirconium, tin, cesium, barium, lanthanum, indium, silver, or cerium.