simplify exit code handling