Cut some repetition in templates. (#415)