use exceptions instead of boolean return values to simplify the code