moved exit status handling out of parser