Separated dialog from common js