This is way more complicated than it needs to be. If it's just adding this chunk of HTML, we can just inflate the template and append it, we don't need a separate function that does that. Look over how the tabs render themselves, it's not difficult.