Refactor options dialog.