Refactor to PEP8 (not complete)