factor out renderEmptyHeader function