Common logic to the TOML formatter
