factor out header