Factorized code for dialogs.
Merge pull request #34 from Pombo/feature_kim

Factorized code for dialogs.