Updated Obsolete GetTypedClient to As in the example