Refactor and reformat base.html