DRYed out the template fetching