added tests and refactored
updated packages.json