change singleton to factory export