add factory.js