public function onNodePrepare(NodeEvent $event)
    {
        $node = $event->getNode();

        if (!empty($node->group_id)) {
            return; // Someone took care of this for us
        }

        $node->group_id = $this->findMostRelevantGroupId();
        $node->is_ghost = (int)$this->findMostRelevantGhostValue($node);
    }