one last bit of moving pieces around to add. This replaces the function that used to read the template file multiple times