refactoring npm interface