Better JSON formatting of attributes