Refactor codes
Refactor codes
Update npm
Add tests