CommonJS refactor