Refactor dialogs / fix all Checkstyle and FindBug issues