how metal is melted and purified