Code clean up using PyCharm inspection tools