Commercially, selenium is produced as a byproduct in the refining of some ores, most often during copper production. Minerals that are pure selenide or selenate compounds are known, but are rare. Selenium is used with bismuth in brasses to replace more toxic lead. Like lead and sulfur, selenium improves the machinability of steel. The same improvement is also observed in copper alloys.