simplified the template logic by pushing it (rightly) into the view.