create factory.js