Because `beanFactory instanceof BeanDefinitionRegistry` is used former, so `beanFactory` should be used latter.