Refactored using all needed dependencies as npm modules