added toggle input
refactoring forms and dialogs