refactored for npm registry