refactoring for passing pylint test