Extract a little bit of duplication in LegacyFormatter