Good idea to encapsulate this in a function, but using the text of the links as the source of truth may pose problems, because what happens if the text needs to change... then you also need to change this function.

Of course, you guys are learning some techniques to fix this problem this week.