Working with files and templates