add contextfactory class