modularize for npm