Simplified endgame logic to help with xmpp merge.