some refactorization for checkOkButton

Authored by fkristof on Aug 27 2017, 10:10 PM.