quality determination: Use EAFP
error handling: Use "err" instead of "e"