Layout and template improvements