Writing content only when present