simplify error handling code in Config