using Pylint to improve code

using Pylint to improve code