Expanding templates