moved ApplicationContext to main method.