#52: small refactoring insertHeader