Remove unused code, PEP8 cleanups