Code improvement for a better pylint result