update loader to use client factory.