change how template name extraction works; add another unit test