refactoring with npm deps