Code cleanup + some PEP8