Use locals in layout lookup so as not to have any unwanted side effects.