Refactor header code into partials