Only substitute templates in variables once the order of all injected variables has been decided