PEP-8 polish: Remove unused imports, indentation correction. Make code more pythonic etc.