split validate-class logic