Refactory popupwindow and several UserControls.