added neglected helper function for template switching