Some cleanup, slightly more PEP8 compliant