--- a/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/TavernaExtractor.java
+++ b/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/TavernaExtractor.java
@@ -153,7 +153,6 @@
     private IFolder applicationFolder;
     private IFolder relationsFolder;
 
-
     /*
      * // PROPERTIES & ARGUMENTS //////////////
      */
@@ -295,32 +294,20 @@
         elementModelObjectMap = new HashMap<String, IDiagramModelArchimateObject>();
         relations = new ArrayList<IRelationship>();
 
+        File tavernaFile = null;
         try {
-            // try to load from classpath
-//            URL workflowURL = getClass().getResource(inputFileName);
-//
-//            if (workflowURL == null) { // if not successful, try opening file
-//
-//                File f = new File(inputFileName);
-//                if (f.exists()) {
-//                    workflowURL = f.toURI().toURL();
-//                }
-//            }
 
             URL workflowURL = null;
-            File file = null;
             try {
                 Session session = sshManager.createSession(15000);
-                file = sshManager.readFile(session, inputFileName.toString());
+                tavernaFile = sshManager.readFile(session, inputFileName.toString());
             }
             catch(SSHManagerException e){
                 e.printStackTrace();
             }
 
-
-
-            if (file.exists()) {
-                    workflowURL = file.toURI().toURL();
+            if (tavernaFile.exists()) {
+                    workflowURL = tavernaFile.toURI().toURL();
             }
 
             LOGGER.info( "Reading workflow from " + workflowURL);
@@ -584,9 +571,8 @@
         // Set model version
         model.setVersion(ModelVersion.VERSION);
 
-
         //create tmp file
-        Path outputTmp = Files.createTempFile("taverna-extractor","output");
+        Path outputTmp = Files.createTempFile("tavernaExtractor-",".output");
 
         // Adapted from {@link ArchiveManager#saveModelToXMLFile}
         ResourceSet resourceSet = ArchimateResourceFactory.createResourceSet();
@@ -596,6 +582,19 @@
         resource.save(null);
 
         LOGGER.info( "Wrote model successfully to " + outFile.getAbsolutePath());
+
+        // copy temp file to remote host
+        try {
+            Session session = sshManager.createSession(15000);
+            sshManager.sendFile(session, outputTmp.toString(), archimateOutputPath.toString());
+        }
+        catch(SSHManagerException e){
+            e.printStackTrace();
+        }
+
+        // remove both temp files.
+        Files.deleteIfExists(outputTmp);
+        Files.deleteIfExists(tavernaFile.toPath());
     }
 
     public void processWebServiceActivity(IFolder businessFolder, IFolder infrastructureFolder,