Hygiene: Move code for header into _getTitleElement

Change-Id: Ic53933189bf51772a88689794a7633ba8ba0ac2c