Move custom exception classes into abstract one