Bacterial metabolism and energy production