refactoring and fixes
update select dialogs and more refactoring