split out header
refactored with private methods