removeTopLevelBraces is template