made finding template file a lot smarter.