Cleaned up code according to PyCharm's recommendations.