Refactor header/footer and media model