refactor and add package.json