Refactoring view.coffee