public static Model loadFrom(String filename) throws IOException {
        try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename))) {
            final Model model = (Model) ois.readObject();
            // everything went well, remember the original file
            model.setBackingFile(filename);
            return model;
        } catch (final FileNotFoundException e) {
            throw e;
        } catch (IOException | ClassNotFoundException e) {
            throw new IOException("I/O error while loading model from file '" + filename + "'", e);
        }
    }