Refactor FormatStruct and FormatMap into Format