Clean up the code for getting the commodities.