Save dialog refactoring.