simplify template_dir construction