Refactoring, save and load from file