refactoring sources for commonjs
mocha test