Switched to WindowXMLDialog, some code cleanup