polished code for pylint