If we return ``ordered`` rendering the attributes becomes easier (see below) -

  <pre>
    attributes = (main_attributes | custom_field_attributes | hook_attributes).compact
    attributes.each_slice((attributes.length+1)/2).to_a
  </pre>