Refactoring + add 'main' to package.json