Improved device template and templates export/import #350