separate code in ThirdPartyHandler