Create factory.js