PyLint refactor