Move view-related stuff to the template. Also, attach the model to the view for later usage