In steelmaking, nonmetallic impurities such as $\mathrm{P}, \mathrm{S}$, and Si are removed as the corresponding oxides. The inside of the furnace is usually lined with $\mathrm{CaCO}_3$ and $\mathrm{MgCO}_3$, which decompose at high temperatures to yield CaO and MgO . How do CaO and MgO help in the removal of the nonmetallic oxides?