It's similar to regular smelting of ores- roasting, reduction, and flux additives. https://en.wikipedia.org/wiki/Smelting
At the front, there must be a separation out of undesirable materials, and at the end, there should be a determination of purity and major contaminants.