Revert "The order of the formats matters. Use OrderedDict instead of dict"

I can't rely on the order of dict. The control flow is more complex.

This reverts commit 3389ed71971ddacd185bbbf8fe667a8651108c70.