How do templates work?