Review fixes

I have made some code style fixes and refactored the Validator.

This should address most of the issues in the original pull request.