Refactoring to make pylint a bit more happy