Change exceptionhandling to me more generic