Minor opt. to data.py - run template_to_regex once out of loop