Can this be simplified to `pageManager.getContainingPage(ref) != null`