template grammar fixed