add prepareTemplate (and test)