Set up master pages with templates