how are ores processed to obtain metals