I understand you do this to keep the template (and I missed this in my initial review, so it is a good catch!), but I don't find this is very elegant. I think the best (and simpler) solution is to put the template out of the <ul> in the markup.