Refactoring and pylint changes.