refactor validator general class