fix exception handler, simplify config creation