Refactoring of saving/loading methods