refactoring custom exceptions