refactored for npm
merging