Modified to use templates in for folder directories