Refactored dialog and css.

Refactored dialog and css.