suggested improvements

and exception handling fixes