Editing Format of List of Theorems in thmtools

I'm trying to change the formatting of the \listoftheorems command from the thmtools package. It currently prints "Theorem (Name of Theorem).... Page Number", and I would like it to print "Name of Theorem....Page Number". I have attempted to use the fixes here Only show \NAME in \listoftheorems and here Generating lists of custom environment. to no avail.

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}
\renewcommand{\listtheoremname}{List of Important Theorems}

\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
notefont=\bfseries, notebraces={(}{)},
bodyfont=\normalfont,
qed={}
]{theorem}

\declaretheorem[style=theorem]{theorem}
\begin{document}
\listoftheorems
\begin{theorem}[Test]
This is a test theorem.
\end{theorem}
\end{document}


In fact, the answer given by egreg to Generating lists of custom environment. applies here, mutatis mutandis:

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}

\renewcommand{\listtheoremname}{List of Important Theorems}

\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
notefont=\bfseries, notebraces={(}{)},
bodyfont=\normalfont,
qed={},
]{theorem}

\declaretheorem[style=theorem]{theorem}

\makeatletter
\def\ll@theorem{%
\protect\numberline{\csname the\thmt@envname\endcsname}%
\ifx\@empty\thmt@shortoptarg
\thmt@thmname
\else
\thmt@shortoptarg
\fi}
\def\l@thmt@theorem{}
\makeatother

\begin{document}
\listoftheorems
\begin{theorem}[First test theorem]
This is a test theorem.
\end{theorem}
\begin{theorem}[Second test theorem]
This is another test theorem.
\end{theorem}
\begin{theorem}
This is another test theorem.
\end{theorem}

\end{document}


As can be seen in the example above, the previous solution will still typeset just "Number Theorem ... Page" for theorems in which no optional argument is used. If you want to suppress those from the list and only include there those which have a name, then you can use:

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools}

\renewcommand{\listtheoremname}{List of Important Theorems}
\makeatletter
\declaretheoremstyle[
spaceabove=6pt, spacebelow=6pt,
notefont=\bfseries, notebraces={(}{)},
bodyfont=\normalfont,
qed={},
\ifx\@empty\thmt@shortoptarg
\fi}
]{theorem}
\makeatother

\declaretheorem[style=theorem]{theorem}

\makeatletter
\def\ll@theorem{%
\protect\numberline{\csname the\thmt@envname\endcsname}%
\ifx\@empty\thmt@shortoptarg
\thmt@thmname
\else
\thmt@shortoptarg
\fi}
\def\l@thmt@theorem{}
\makeatother

\begin{document}
\listoftheorems
\begin{theorem}[First test theorem]
This is a test theorem.
\end{theorem}
\begin{theorem}[Second test theorem]
This is another test theorem.
\end{theorem}
\begin{theorem}
This is another test theorem.
\end{theorem}

\end{document}