consistent use of class instead of struct for exceptions