Minor pylint fixes & refactoring