Code review changes and pep8 and pylint cleaning