Simplify main.js using data binding