Finish cutting some repetition in templates. (#415)