refactor schema validator; pylint and pep8