Better handling of templates files