Pylint-guided code cleanup