Moved access to Preferences to ApplicationContext