Could you factor out this code block? There is the same code in DeprecatedInputFormatWrapper