tests correction for B and P, code validator refactoring