pylint refactoring