Fix and refactor header