Refactor setting of page title