converted ClientId impersonation code to EntityId