Exergy loss reduction by combining exothermic and endothermic reaction routes