dialog reconstructed to OOP style.