Optimization code. Template emergency is now extended from the base.html