remove iterating through the directory and setting the templates