Refactor ResultDialog