To reconcile the notion of a benevolent and powerful God with the actual human suffering, Leibniz proposed the idea idea that while our world is not perfect, it is the best of possible worlds. This idea inspired important developments in physics: namely, it turned out that equations of motions and equations which describe the dynamics of physical fields can be deduced from the condition that the (appropriately defined) action functional is optimal. In practice, this idea is not always very helpful in physics applications: to fully utilize this fact, we need to how the action, and there are many possible action functionals. Our idea is to apply Leibniz's insight once again and to assume that (similarly) on the set of all action functionals, there is an optimality criterion, and the actual action functional is optimal with respect to this criterion. This idea enables us to derive the standard equations of General Relativity, Quantum Mechanics, Electrodynamics, etc. only from the fact that the corresponding expressions for action are optimal. Thus, the physical equations describing our world are indeed the best possible.