package.json and small refactoring