make better use of the exceptions