simplified version with mocha