updated factory export to support amd/require