Metal production and processing