Refactor h1 and page title rendering