Refactoring logic buttons Save and SaveAs