Handle locations within templates better