single class for exception and use of case and