Factored out exit code.