rework routing so template directories are always accurate, and it's a tad faster