move configuration reading from ews to main