create and use template directory