reactoring classes coupling and dependencies in NPM