rewrite with emphasis on file-based templates