Refactor the view and javascript.