use exceptions for error reporting instead of booleans