refactoring, and added Save As