Code tidy up

remove generic exceptions where possible