Getting the user class optional and managing exceptions.