Added template variable functionality