Improve to allow underscores in template names