what are the by products of producing metals through mining