Validator as a separate class