ENYO-3762: minor refactoring of the function "enableOkButton()" by warping each steps into an inner function.