first attempt at cleaning up tir template and loading