refactor validator source code into separate files