Refactor the poll_view.js