Moved more boilerplate code into base.html