CommonJS refactoring