I would suggest simply to refer to `openDialog` in `utils.js` and avoid duplicate code.