Replacing the above BeanFactory with the more powerful
ApplicationContext.