action refactoring and window modality