I don't know what I was thinking by templating this function.