Consider working from this snippet (might need some slight adjustment) to retrieve the underlying model more directly: