Refactored saving