Split out view into separate js file