Normalized index.js, added event triggers