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