base.html refactor