Changing local references for templates