consider caching template file in local storage