mini refactoring.
added Debag diarog format and source.
refactaring for Debug dialog.