Split up logic in header_to_s