lines above are executed onSave, onCancel, onClose
propose to unite commands in separate private method