refactored config_read