Refactor headers tests.