Further improve demo
Refactor wiring code from index.html into app.js