refactoring and adding a packages.json