Refine and centralize mx.root determination