normalize template keys