refactored validator test