DAR-2604, modal JS refactoring
DAR-2604, modal refactoring