Refactored configuration reading to to improve encapsulation