refactoring
mocha test