pylint and refactor