I tried to keep the platform code separate from the view in the refactor, that's why I did the event handling in index.js. But this introduces platform code into the view.