refector
add test to npm module