Reorganized functions and some fixes.

recoverValidationCodeDriver