rewrite using promises
add coverage
2.0.0