Optimizing use of heat to minimize food safety risks, maximize food quality