Hi Igor,
thanks for the description.
I think this code belongs in the place where the templates are defined, not here in DataFormats.
I will need comments from the core team if this could have implications on maintenance.