Refactor modal-window click event