refactored config_reader