Optimization of ATP synthase function in mitochondria and